﻿<Window x:Class="Charts.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Charts"
        xmlns:s="clr-namespace:System;assembly=mscorlib"
        xmlns:conv="clr-namespace:Charts.Converters"
        
        FontFamily="Segoe UI"
        FontWeight="ExtraBlack"
        FontSize="18"
        Foreground="{StaticResource foreground}"
        Background="{StaticResource windowBackground}"
        
        Title="Chart Demo"
        Height="480"
        Width="600">
	
	<Window.DataContext>
		
		<x:Array Type="{x:Type local:DataItem}">
			<local:DataItem Category="Q1" Value="32"/>
			<local:DataItem Category="Q2" Value="21"/>
			<local:DataItem Category="Q3" Value="64"/>
			<local:DataItem Category="Q4" Value="79"/>
		</x:Array>
	</Window.DataContext>
	<DockPanel>
		
		<!--This is not a part of Chart, but demonstrate dependence between data collections elements changing and visualization on Chart-->
		
		<ItemsControl DockPanel.Dock="Bottom"
		              Margin="90,0,15,15"
		              Background="Transparent"
		              BorderBrush="Transparent"
		              ItemsSource="{Binding}"
		              HorizontalContentAlignment="Stretch">
			
			<ItemsControl.ItemsPanel>
				
				<ItemsPanelTemplate>
					<UniformGrid IsItemsHost="True" Columns="{Binding Path=Count}"/>
				</ItemsPanelTemplate>
			
			</ItemsControl.ItemsPanel>
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<Grid HorizontalAlignment="Stretch" Background="Transparent">
						
						<Slider Grid.Column="0"
						        Foreground="White"
						        VerticalAlignment="Center"
						        HorizontalAlignment="Stretch"
						        Minimum="0"
						        Maximum="100"
						        Name="slider"
						        Value="{Binding Path=Value}"
						/>
					</Grid>
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>
		
		<Control Template="{StaticResource ChartTemplate}"/>
	
	</DockPanel>
</Window>